void de(struct ListNode* head, struct ListNode* pos)
{
    struct ListNode* temp = head;
    while (temp->next != pos)
    {
        temp = temp->next;
    }
    temp->next = temp->next->next;
}

struct ListNode* deleteDuplicates(struct ListNode* head) {
    if (head == NULL)
        return head;
    struct ListNode* temp = head;
    while (temp)
    {
        struct ListNode* tmp = temp->next;
        while (tmp)
        {
            if (temp->val == tmp->val)
            {
                struct ListNode* p = tmp->next;
                de(head, tmp);
            }
            tmp = tmp->next;
        }
        temp = temp->next;
    }
    return head;
}